package com.znyj.cloud.device.pack;

import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * Created by gaoliwei02 on 17/8/7.
 */
public class BasePackage {

    private int msgHead;
    private int dataCrc;
    private int version;
    private int format;
    private int reserved;
    private int dataLength;

    private byte[] payloadData;
    private JSONObject jsonObject;

    public int getMsgHead() {
        return msgHead;
    }

    public void setMsgHead(int msgHead) {
        this.msgHead = msgHead;
    }

    public int getDataCrc() {
        return dataCrc;
    }

    public void setDataCrc(int dataCrc) {
        this.dataCrc = dataCrc;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public int getFormat() {
        return format;
    }

    public void setFormat(int format) {
        this.format = format;
    }

    public int getReserved() {
        return reserved;
    }

    public void setReserved(int reserved) {
        this.reserved = reserved;
    }

    public int getDataLength() {
        return dataLength;
    }

    public void setDataLength(int dataLength) {
        this.dataLength = dataLength;
    }

    public byte[] getPayloadData() {
        return payloadData;
    }

    public void setPayloadData(byte[] payloadData) {
        this.payloadData = payloadData;
    }

    public JSONObject getJsonObject() {
        return jsonObject;
    }

    public void setJsonObject(JSONObject jsonObject) {
        this.jsonObject = jsonObject;
    }

    @Override
    public String toString() {
        return ReflectionToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
    }

}
